package com.example.service.impl;

import com.example.service.BookShopService;
import com.example.service.Carshier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @program: overer
 * @description:
 * @author: 诸葛龙辰
 * @create: 2022-11-14 21:14
 **/
public class CarshierImpl implements Carshier {
    @Autowired
    private BookShopService bookShopService;

    @Transactional
    public void buy(List<String> isbns, String username) {

        for (String isbn : isbns) {
            bookShopService.purchase(isbn, username);
        }
    }

}
